package com.warmlight.voicepacket.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.warmlight.voicepacket.dbdata.DBSearchHistory;
import com.warmlight.voicepacket.dbdata.DBFloatPlaylist;
import com.warmlight.voicepacket.dbdata.DBFloatPlayListDetail;
import com.warmlight.voicepacket.dbdata.Student;

import com.warmlight.voicepacket.dao.DBSearchHistoryDao;
import com.warmlight.voicepacket.dao.DBFloatPlaylistDao;
import com.warmlight.voicepacket.dao.DBFloatPlayListDetailDao;
import com.warmlight.voicepacket.dao.StudentDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig dBSearchHistoryDaoConfig;
    private final DaoConfig dBFloatPlaylistDaoConfig;
    private final DaoConfig dBFloatPlayListDetailDaoConfig;
    private final DaoConfig studentDaoConfig;

    private final DBSearchHistoryDao dBSearchHistoryDao;
    private final DBFloatPlaylistDao dBFloatPlaylistDao;
    private final DBFloatPlayListDetailDao dBFloatPlayListDetailDao;
    private final StudentDao studentDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        dBSearchHistoryDaoConfig = daoConfigMap.get(DBSearchHistoryDao.class).clone();
        dBSearchHistoryDaoConfig.initIdentityScope(type);

        dBFloatPlaylistDaoConfig = daoConfigMap.get(DBFloatPlaylistDao.class).clone();
        dBFloatPlaylistDaoConfig.initIdentityScope(type);

        dBFloatPlayListDetailDaoConfig = daoConfigMap.get(DBFloatPlayListDetailDao.class).clone();
        dBFloatPlayListDetailDaoConfig.initIdentityScope(type);

        studentDaoConfig = daoConfigMap.get(StudentDao.class).clone();
        studentDaoConfig.initIdentityScope(type);

        dBSearchHistoryDao = new DBSearchHistoryDao(dBSearchHistoryDaoConfig, this);
        dBFloatPlaylistDao = new DBFloatPlaylistDao(dBFloatPlaylistDaoConfig, this);
        dBFloatPlayListDetailDao = new DBFloatPlayListDetailDao(dBFloatPlayListDetailDaoConfig, this);
        studentDao = new StudentDao(studentDaoConfig, this);

        registerDao(DBSearchHistory.class, dBSearchHistoryDao);
        registerDao(DBFloatPlaylist.class, dBFloatPlaylistDao);
        registerDao(DBFloatPlayListDetail.class, dBFloatPlayListDetailDao);
        registerDao(Student.class, studentDao);
    }
    
    public void clear() {
        dBSearchHistoryDaoConfig.clearIdentityScope();
        dBFloatPlaylistDaoConfig.clearIdentityScope();
        dBFloatPlayListDetailDaoConfig.clearIdentityScope();
        studentDaoConfig.clearIdentityScope();
    }

    public DBSearchHistoryDao getDBSearchHistoryDao() {
        return dBSearchHistoryDao;
    }

    public DBFloatPlaylistDao getDBFloatPlaylistDao() {
        return dBFloatPlaylistDao;
    }

    public DBFloatPlayListDetailDao getDBFloatPlayListDetailDao() {
        return dBFloatPlayListDetailDao;
    }

    public StudentDao getStudentDao() {
        return studentDao;
    }

}
